
package requests

import (
	"github.com/goravel/framework/contracts/http"
	"github.com/goravel/framework/contracts/validation"
)

type StoreCartRequest struct {

	Uid string `json:"uid" form:"uid"`

	Type string `json:"type" form:"type"`

	ProductId string `json:"product_id" form:"product_id"`

	ProductAttrUnique string `json:"product_attr_unique" form:"product_attr_unique"`

	CartNum string `json:"cart_num" form:"cart_num"`

	AddTime string `json:"add_time" form:"add_time"`

	IsPay string `json:"is_pay" form:"is_pay"`

	IsDel string `json:"is_del" form:"is_del"`

	IsNew string `json:"is_new" form:"is_new"`

	CombinationId string `json:"combination_id" form:"combination_id"`

	SeckillId string `json:"seckill_id" form:"seckill_id"`

	BargainId string `json:"bargain_id" form:"bargain_id"`

	AdvanceId string `json:"advance_id" form:"advance_id"`

	Status string `json:"status" form:"status"`

}

func (r *StoreCartRequest) Authorize(ctx http.Context) error {
	return nil
}

func (r *StoreCartRequest) Rules(ctx http.Context) map[string]string {
	return map[string]string{

		"uid": "required",

		"type": "required",

		"product_id": "required",

		"product_attr_unique": "required",

		"cart_num": "required",

		"add_time": "required",

		"is_pay": "required",

		"is_del": "required",

		"is_new": "required",

		"combination_id": "required",

		"seckill_id": "required",

		"bargain_id": "required",

		"advance_id": "required",

		"status": "required",

	}
}

func (r *StoreCartRequest) Messages(ctx http.Context) map[string]string {
	return map[string]string{}
}

func (r *StoreCartRequest) Attributes(ctx http.Context) map[string]string {
	return map[string]string{}
}

func (r *StoreCartRequest) PrepareForValidation(ctx http.Context, data validation.Data) error {
	return nil
}
